﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace Wpf.CommonTools.StaticExtension
{
    public static class RegexExtension
    {
        public static string TryToUnEscape(this string str)
        {
            try
            {
                str = Regex.Unescape(str);
            }
            catch { }
            return str;
        }

        public static bool CanUnEscape(this string str)
        {
           string escStr = Regex.Escape(str);
            try
            {
                str = Regex.Unescape(str);
            }
            catch { return false; }
            return true;
        }
    }
}
